package com.ssm.helong.shop.Dao;

import com.ssm.helong.shop.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserDao {
    /**
     * 注册
     * @param user
     * @return
     */
    int insert(User user);

    int insertSelective(User user);

    /**
     * 查询
     * @param userId
     * @return
     */
    User selectByPrimaryKey(Integer userId);

    User selectByLoginName(String userLoginName);

    User selectByLoginNameAndPassword(@Param("userLoginName") String userLoginName, @Param("userLoginPassword") String userPassword);

    /**
     * 修改
     * @param user
     * @return
     */
    int updateByPrimaryKeySelective(User user);

    int updateByPrimaryKey(User user);

    /**
     * 注销用户
     * @param userId
     * @return
     */
    int deleteByPrimaryKey(Integer userId);


}
